package com.isay.frameworklib.utils;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;

/**
 * Created by cywu4 on 2019/2/26.
 */
public class WebUrlUtils {


    /**
     * 通过浏览器打开url
     *
     * @param context
     * @param url
     */
    public static void openUrl(Context context, String url) {
        if (context instanceof Activity) {
            if (url != null && url.contains("http")) {
                Uri uri = Uri.parse(url);
                Intent intent = new Intent(Intent.ACTION_VIEW, uri);
                context.startActivity(intent);
            }
        }
    }

}
